function zc(){
    var regName = /^.{4,16}$/
    var regPwd = /^[a-zA-Z0-9]{4,10}$/
    var regemail = /^\w+@\w+\.\w+[(com)|(cn)]$/

    var name = document.getElementById("zcuser").value
    var pwd = document.getElementById("zcpwd").value
    var email = document.getElementById("zcemail").value
    
    if(regName.test(name) && regPwd.test(pwd) && regemail.test(email)){
      localStorage.setItem("name",name)
      localStorage.setItem("pwd",pwd)
      localStorage.setItem("email",email)
    alert("注册成功")
      return true
    }else{
      alert("用户名或密码格式有误！")
      return false
    }
}

function dl(){
    var user = document.getElementById("dluser").value
    var pwd = document.getElementById("dlpwd").value
    var username = JSON.parse(localStorage.getItem("name"))
    var userpwd = JSON.parse(localStorage.getItem("pwd"))
    if(user == username || pwd == userpwd){
        alert("登录成功")
        location.href = "index.html"
    }else{
        alert("用户名或密码错误")
    }
}